<?php
class Ecore_Upload_Other {		
	public static function upload($file)
	{
		if ($file['name'] != '') {	
			$strFolder					= date('Y/m/d/');
			$strFullFolder 				= DIR_OTHER . $strFolder;
			$arrUploadResult 			= Ecore_Upload_Common::process($file, $strFullFolder, IMAGE_SIZE*1024*1024);
			if ($arrUploadResult['error'] == 0) {
				$arrUploadResult['path']	= $strFolder . $arrUploadResult['name'];
				$strFullPath 				= $arrUploadResult['fullpath'];				
				$strFileName				= $arrUploadResult['name'];				
				$objThumb 					= new Ecore_Thumbnail($strFullPath);				
				if ($arrUploadResult['width'] > IMAGE_FULL_SIZE) {
					$objThumb->quality 		  	= 100;
					$objThumb->output_format 	= 'JPG,JPEG,jpg,jpeg,GIF,gif,PNG,png';
					$objThumb->jpeg_progressive = 1;
					$objThumb->bicubic_resample = false;
					$objThumb->allow_enlarge	= false;
					$objThumb->size_width(IMAGE_FULL_SIZE);
					$objThumb->process();
					$objThumb->save($strFullPath);					
				}								
			}
			return $arrUploadResult;
		}
		return null;
	}
}
?>
